import UIKit

let arr = [10,3,23,234,435]

let a = arr.startIndex
arr[a]

let next = arr.index(after: a)
arr[next]

//字符串应用: 字符串切片技术
let hello = "hello, world"

let start = hello.startIndex
hello[start] // 索引首位是第一个字符

//偏移量5: 首位之后第位
let k = hello.index(start, offsetBy: 5)
hello[k] // ,
//'substring(with:)' is deprecated: Please use String slicing subscript.
hello.substring(with: start..<k)//过时,请使用字符串切片
hello[start ..< k] // hello


